home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-01 / tcoop10a.zip / DOC.ZIP / POINT.DOC < prev    next >
Text File  |  1991-11-20  |  3KB  |  80 lines

  1. POINT.DOC       11/15/91        Copyright (c) 1991 by James S. Clark
  2. ==========================================================================
  3. POINT
  4. Point Class
  5. --------------------------------------------------------------------------
  6. Class Name                      Point
  7. Superclass                      <none>
  8. Category                        Graphics
  9. Other classes referenced        <none>
  10. Other catagories referenced     <none>
  11. Used by                         Mgraphic
  12. Inherited by                    <none>
  13.  
  14. Declaration                     Point   *p = new Point(x, y);
  15.  
  16. Instance Variables
  17.                                 int     x, y;
  18. Instance Methods
  19.                                 Point   ()               { x = 0;  y = 0;  };
  20.                                 Point   (int nx, int ny) { x = nx; y = ny; };
  21.                                 int     getx    ();
  22.                                 int     gety    ();
  23.                                 void    offset  (int dx, int dy);
  24.                                 void    set     (int x, int y);
  25. operators                       Point&  operator = (const Point& p);
  26.                                 Point&  operator + (const Point& p);
  27. --------------------------------------------------------------------------
  28. GENERAL DESCRIPTION
  29.  
  30. The Point Class provides a simple way of working with corrdinates.  While
  31. it is not used directly by the Graphic Class, it is in the Mgraphic Class,
  32. which simplifies parameter passing when Mgraphics is used instead of the
  33. Graphic Class for basic graphics functions.
  34.  
  35. Methods are provided for creation, and offsetting.  Operators are
  36. available for copying and adding points together.
  37.  
  38. --------------------------------------------------------------------------
  39. VARIABLES
  40.  
  41. int     x;
  42.         The x-axis coordinate of the point.
  43.  
  44. int     y;
  45.         The y-axis coordinate of the point.
  46.  
  47. --------------------------------------------------------------------------
  48. METHODS
  49.  
  50. Point   ()               { x = 0;  y = 0;  };
  51.         Creates a point with both coordinates set to NULL.
  52.  
  53. Point   (int nx, int ny) { x = nx; y = ny; };
  54.         Create a point with the coordinates set to x and y.
  55.  
  56. int     getx    ();
  57.         Returns the value of the x coordinate.
  58.  
  59. int     gety    ();
  60.         Returns the value of the y coordinate.
  61.  
  62. void    offset  (int dx, int dy);
  63.         Offsets the point by adding dx and dy to the coordinates.
  64.  
  65. void    set     (int x, int y);
  66.         Sets the value of the point to x and y.
  67.  
  68. Point&  operator = (const Point& p);
  69.         Copies the the values of the point on the right side of the
  70.         sign into the point on the left side of the operator.
  71.  
  72. Point&  operator + (const Point& p);
  73.         Adds the coordinates of the two points and leaves the result
  74.         in the point on the left side of the operator.  Works the same
  75.         as the offset() method.
  76.  
  77. --------------------------------------------------------------------------
  78. POINT.DOC                       Copyright (c) 1991 by James S. Clark
  79. ==========================================================================
  80.